package com.wwwarehouse.resource_center.bean.sales_inventory_statistics;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Jackie on 2017/10/26.
 * 销售库存统计
 */

public class SalesInventoryStatisticsResponseBean implements Parcelable {
    /**
     * page : 1
     * size : 8
     * total : 2
     * list : [{"itemCode":"a1","itemUrl":"http://192.168.1.100/1.png","validQty":2,"soldQty":2,"validRatio":2}]
     */

    private int page;
    private int size;
    private int total;
    private List<ListBean> list;

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public List<ListBean> getList() {
        return list;
    }

    public void setList(List<ListBean> list) {
        this.list = list;
    }

    public static class ListBean implements Parcelable {
        /**
         * itemCode : a1
         * itemUrl : http://192.168.1.100/1.png
         * validQty : 2
         * soldQty : 2
         * validRatio : 2
         */

        private String itemCode;
        private String itemUrl;
        private int validQty;
        private int soldQty;
        private double validRatio;

        public String getItemCode() {
            return itemCode;
        }

        public void setItemCode(String itemCode) {
            this.itemCode = itemCode;
        }

        public String getItemUrl() {
            return itemUrl;
        }

        public void setItemUrl(String itemUrl) {
            this.itemUrl = itemUrl;
        }

        public int getValidQty() {
            return validQty;
        }

        public void setValidQty(int validQty) {
            this.validQty = validQty;
        }

        public int getSoldQty() {
            return soldQty;
        }

        public void setSoldQty(int soldQty) {
            this.soldQty = soldQty;
        }

        public double getValidRatio() {
            return validRatio;
        }

        public void setValidRatio(double validRatio) {
            this.validRatio = validRatio;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.itemCode);
            dest.writeString(this.itemUrl);
            dest.writeInt(this.validQty);
            dest.writeInt(this.soldQty);
            dest.writeDouble(this.validRatio);
        }

        public ListBean() {
        }

        protected ListBean(Parcel in) {
            this.itemCode = in.readString();
            this.itemUrl = in.readString();
            this.validQty = in.readInt();
            this.soldQty = in.readInt();
            this.validRatio = in.readInt();
        }

        public static final Creator<ListBean> CREATOR = new Creator<ListBean>() {
            @Override
            public ListBean createFromParcel(Parcel source) {
                return new ListBean(source);
            }

            @Override
            public ListBean[] newArray(int size) {
                return new ListBean[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.page);
        dest.writeInt(this.size);
        dest.writeInt(this.total);
        dest.writeList(this.list);
    }

    public SalesInventoryStatisticsResponseBean() {
    }

    protected SalesInventoryStatisticsResponseBean(Parcel in) {
        this.page = in.readInt();
        this.size = in.readInt();
        this.total = in.readInt();
        this.list = new ArrayList<ListBean>();
        in.readList(this.list, ListBean.class.getClassLoader());
    }

    public static final Parcelable.Creator<SalesInventoryStatisticsResponseBean> CREATOR = new Parcelable.Creator<SalesInventoryStatisticsResponseBean>() {
        @Override
        public SalesInventoryStatisticsResponseBean createFromParcel(Parcel source) {
            return new SalesInventoryStatisticsResponseBean(source);
        }

        @Override
        public SalesInventoryStatisticsResponseBean[] newArray(int size) {
            return new SalesInventoryStatisticsResponseBean[size];
        }
    };
}
